package com.study.hospital_3.controller;

import com.study.hospital_3.service.InstrumentService;
import com.study.hospital_3.vo.InstrumentUpdateVO;
import com.study.hospital_3.vo.InstrumentVo;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;
import java.util.Map;
@RequestMapping("/instrument")
@RestController


public class InstrumentController {

    @Resource

    private InstrumentService instrumentService;

    @GetMapping("/selectInstrument")
    public Map<String, Object> selectInstrument(InstrumentVo instrumentVO) {
        return instrumentService.selectInstrument(instrumentVO);
    }

    @PostMapping("/insert")
    public Map<String, Object> insert(@RequestBody InstrumentVo instrumentVo) {
        return instrumentService.insert(instrumentVo);
    }

    @PostMapping("/deleteById")
    public Map<String, Object> deleteById(@RequestParam Integer id) {
        return instrumentService.deleteById(id);
    }

    @PostMapping("/updateById")
    public Map<String, Object> updateById(@RequestBody  InstrumentUpdateVO instrumentUpdateVO) {
        return instrumentService.updateById(instrumentUpdateVO);
    }


}


